package tripx.db.server;

import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.xml.sax.SAXException;

public class ServerConfig {

	private static ServerConfig config;

	Document configDoc;

	private ServerConfig() {
		File configFile = new File("./config/server.xml");
		try {
			configDoc = DocumentBuilderFactory.newInstance()
					.newDocumentBuilder().parse(configFile);
		} catch (SAXException | IOException | ParserConfigurationException e) {

		}
	}

	public static ServerConfig getInstance() {
		if (config == null) {
			config = new ServerConfig();
		}
		return config;
	}

}
